From: Aaron Schulz Date: Wed, 24 Sep 2008 20:30:10 +0000 (+0000) Subject: * Rename randomInsert() to insertToDefault() X-Git-Tag: 1.31.0-rc.0~45107 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=7b2aa9670f375d7ba643b7083a976f3af5ed0452;p=lhc%2Fweb%2Fwiklou.git * Rename randomInsert() to insertToDefault() * Use insertToDefault() to insert revisions (talked to brion on this) --- diff --git a/includes/ExternalStore.php b/includes/ExternalStore.php index 272bcfc000..d095aba01d 100644 --- a/includes/ExternalStore.php +++ b/includes/ExternalStore.php @@ -75,7 +75,7 @@ class ExternalStore { * @param string $data * Returns the URL of the stored data item, or false on error */ - public static function randomInsert( $data ) { + public static function insertToDefault( $data ) { global $wgDefaultExternalStore; $tryStores = (array)$wgDefaultExternalStore; $error = false; diff --git a/includes/Revision.php b/includes/Revision.php index b1d293ee4a..c369571ece 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -762,18 +762,8 @@ class Revision { # Write to external storage if required if ( $wgDefaultExternalStore ) { - if ( is_array( $wgDefaultExternalStore ) ) { - // Distribute storage across multiple clusters - $store = $wgDefaultExternalStore[mt_rand(0, count( $wgDefaultExternalStore ) - 1)]; - } else { - $store = $wgDefaultExternalStore; - } // Store and get the URL - $data = ExternalStore::insert( $store, $data ); - if ( !$data ) { - # This should only happen in the case of a configuration error, where the external store is not valid - throw new MWException( "Unable to store text to external storage $store" ); - } + $data = ExternalStore::insertToDefault( $data ); if ( $flags ) { $flags .= ','; }